CFLAGS = -Wall -g -c -I. -Idrv -Icommon
all:clean
	arm-linux-gcc $(CFLAGS) -o interupt.o interupt.c
	arm-linux-gcc $(CFLAGS) -o LedDrv.o drv/LedDrv.c
	arm-linux-gcc $(CFLAGS) -o start.o start.S
	arm-linux-gcc $(CFLAGS) -o NandDrv.o drv/NandDrv.c
	arm-linux-gcc $(CFLAGS) -o sub_start.o sub_start.c
	arm-linux-gcc $(CFLAGS) -o UartDrv.o drv/UartDrv.c
	arm-linux-gcc $(CFLAGS) -o KeyDrv.o drv/KeyDrv.c
	arm-linux-gcc $(CFLAGS) -o PmwDrv.o drv/PmwDrv.c
	arm-linux-gcc $(CFLAGS) -o I2cDrv.o drv/I2cDrv.c
	arm-linux-gcc $(CFLAGS) -o commlib.o common/commlib.c
	arm-linux-gcc $(CFLAGS) -o eventQueue.o common/eventQueue.c
	arm-linux-gcc $(CFLAGS) -o timer.o common/timer.c
	arm-linux-gcc $(CFLAGS) -o schedule.o common/schedule.c
	arm-linux-gcc $(CFLAGS) -o sub_schedule.o common/sub_schedule.S
	arm-linux-gcc $(CFLAGS) -o main.o main.c
	arm-linux-gcc $(CFLAGS) -o music.o music.c
	arm-linux-gcc $(CFLAGS) -o dumb.o dumb.c	
	arm-linux-ld -T nand.lds -o nand.elf *.o 
	arm-linux-objcopy -O binary nand.elf nand.bin
	arm-linux-objdump -D -m arm nand.elf > nand.dis
	rm -rf *.o
	cp -r $(shell pwd) /mnt/hgfs/as/

clean:
	rm -rf *.o *.elf *.bin *.dis *~
